import {Component, OnInit} from '@angular/core';
import {MymenuService,MenuItem,MenuStructure} from "../mymenu.service";

@Component({
  selector: 'app-mymenu',
  templateUrl: './mymenu.component.html',
  styleUrl: './mymenu.component.css'
})
export class MymenuComponent {
  menuItems: any[] = [];
  constructor(private mymenuService: MymenuService) {

  }
  getMenu():MenuStructure[] {
    if(this.menuItems.length===0)
      this.menuItems=this.mymenuService.getMenuData('http://localhost:8080/resourceinfo/resmap');
    return  this.menuItems;
  }
}
